﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Rhino.Mocks;

namespace EventHandler.Libraries.Business.Tests
{
    [TestFixture]
    public class AuthenticatorTest
    {
        [Test]
        public void LoginPassedTest()
        {
            var provider = MockRepository.GenerateMock<IAuthenticationProvider>();
            Authenticator auth = new Authenticator(provider);
            provider.Expect(x => x.Login()).Return(true);
            bool loginSuccessful = auth.Login();
            Assert.IsTrue(loginSuccessful);
        }

        [Test]
        public void LoginFailedTest()
        {
            var provider = MockRepository.GenerateMock<IAuthenticationProvider>();
            Authenticator auth = new Authenticator(provider);
            provider.Expect(x => x.Login()).Return(false);
            bool loginSuccessful = auth.Login();
            Assert.IsFalse(loginSuccessful);
        }


    }
}
